<template>
    <div>
       <h1>交换变量</h1>
       变量1{{ num1 }}
       变量2{{ num2 }}
       <button @click="changeNum">交换</button>
    </div>
  </template>
  
  <script>
  export default {
    data(){
      return{
        num1 : 100,
        num2 : 200
      }
    },
    methods:{
      changeNum(){
         this.num = ''
         this.num = this.num1 
         this.num1 = this.num2
         this.num2 = this.num
  
  
      }
    }
  
  }
  </script>
  
  <style>
  
  </style>